import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {ParkIntroduceForm, ParkIntroduceQuery, ParkIntroduceVO} from '@/api/park/parkIntroduce/types';

/**
 * 查询关于我们介绍列表
 * @param query
 * @returns {*}
 */

export const listParkIntroduce = (query?: ParkIntroduceQuery): AxiosPromise<ParkIntroduceVO[]> => {
  return request({
    url: '/park/parkIntroduce/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询关于我们介绍详细
 * @param introduceId
 */
export const getParkIntroduce = (introduceId: string | number): AxiosPromise<ParkIntroduceVO> => {
  return request({
    url: '/park/parkIntroduce/' + introduceId,
    method: 'get'
  });
};

/**
 * 新增关于我们介绍
 * @param data
 */
export const addParkIntroduce = (data: ParkIntroduceForm) => {
  return request({
    url: '/park/parkIntroduce',
    method: 'post',
    data: data
  });
};

/**
 * 修改关于我们介绍
 * @param data
 */
export const updateParkIntroduce = (data: ParkIntroduceForm) => {
  return request({
    url: '/park/parkIntroduce',
    method: 'put',
    data: data
  });
};

/**
 * 删除关于我们介绍
 * @param introduceId
 */
export const delParkIntroduce = (introduceId: string | number | Array<string | number>) => {
  return request({
    url: '/park/parkIntroduce/' + introduceId,
    method: 'delete'
  });
};

/**
 * 查询关于我们介绍
 */
export const getTenantParkIntroduce = (): AxiosPromise<ParkIntroduceVO> => {
  return request({
    url: '/park/parkIntroduce/tenant',
    method: 'get'
  });
};
